﻿using System;
using System.Web.Security;

using Blog.Framework.DataAccess;
using Blog.Framework.Models;

namespace Blog.Framework
{
    public static class Application
    {
        public static void Start()
        {
            BusinessObjectProvider.Instance.ApplicationStart();
        }

        public static void End()
        {
            BusinessObjectProvider.Instance.ApplicationEnd();
        }

        public static string CreateSaltedPassword(string password, string salt)
        {
            return FormsAuthentication.HashPasswordForStoringInConfigFile(password + salt, "sha1");
        }

        public static void CreateAccount(Account account)
        {
            BusinessObjectProvider.Instance.CreateAccount(account);
        }

        public static Account GetAccountForUsername(string username)
        {
            return BusinessObjectProvider.Instance.GetAccountForUsername(username);
        }
    }
}
